﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Web.Mvc;
using SimpComm;


namespace DAL.Enums
{
    #region 提薪时间

    /// <summary>
    /// 提薪时间
    /// </summary>
    public class emUser_Comment_Improve_Salary_Time : MyEnum<byte>
    {
        public static readonly emUser_Comment_Improve_Salary_Time All = new emUser_Comment_Improve_Salary_Time(255, "所有状态");
        public static readonly emUser_Comment_Improve_Salary_Time NotSelect = new emUser_Comment_Improve_Salary_Time(0, "请选择");
        public static readonly emUser_Comment_Improve_Salary_Time EveryMonth = new emUser_Comment_Improve_Salary_Time(1, "每月");
        public static readonly emUser_Comment_Improve_Salary_Time ThreeMonth = new emUser_Comment_Improve_Salary_Time(3, "3个月");
        public static readonly emUser_Comment_Improve_Salary_Time SixMonth = new emUser_Comment_Improve_Salary_Time(6, "半年");
        public static readonly emUser_Comment_Improve_Salary_Time OneYear = new emUser_Comment_Improve_Salary_Time(12, "1年");
        public static readonly emUser_Comment_Improve_Salary_Time TwoYear = new emUser_Comment_Improve_Salary_Time(24, "2年");
        public static readonly emUser_Comment_Improve_Salary_Time UpTwoYear = new emUser_Comment_Improve_Salary_Time(100, "2年以上");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_Improve_Salary_Time> _Items;
        public static List<emUser_Comment_Improve_Salary_Time> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_Improve_Salary_Time)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }
        public static List<emUser_Comment_Improve_Salary_Time> BaseItems
        {
            get { return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static emUser_Comment_Improve_Salary_Time Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_Improve_Salary_Time Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_Improve_Salary_Time(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 用户在企业状态

    /// <summary>
    /// 用户在企业状态
    /// </summary>
    public class emUser_Comment_InComp_State : MyEnum<byte>
    {
        public static readonly emUser_Comment_InComp_State All = new emUser_Comment_InComp_State(255, "所有状态");
        public static readonly emUser_Comment_InComp_State Selected = new emUser_Comment_InComp_State(0, "请选择");
        public static readonly emUser_Comment_InComp_State Employee_Old = new emUser_Comment_InComp_State(1, "曾经的雇员");
        public static readonly emUser_Comment_InComp_State Employee_Now = new emUser_Comment_InComp_State(2, "现任的雇员");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_InComp_State> _Items;
        public static List<emUser_Comment_InComp_State> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_InComp_State)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<emUser_Comment_InComp_State> BaseItems
        {
            get {return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static emUser_Comment_InComp_State Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_InComp_State Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_InComp_State(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 薪酬等级

    /// <summary>
    /// 薪酬等级
    /// </summary>
    public class emUser_Comment_Salary : MyEnum<byte>
    {
        public static readonly emUser_Comment_Salary All = new emUser_Comment_Salary(255, "所有状态");
        public static readonly emUser_Comment_Salary i10 = new emUser_Comment_Salary(10, "1000+");
        public static readonly emUser_Comment_Salary i20 = new emUser_Comment_Salary(20, "2000+");
        public static readonly emUser_Comment_Salary i30 = new emUser_Comment_Salary(30, "3000+");
        public static readonly emUser_Comment_Salary i40 = new emUser_Comment_Salary(40, "4000+");
        public static readonly emUser_Comment_Salary i50 = new emUser_Comment_Salary(50, "5000+");
        public static readonly emUser_Comment_Salary i60 = new emUser_Comment_Salary(60, "6000+");
        public static readonly emUser_Comment_Salary i70 = new emUser_Comment_Salary(70, "7000+");
        public static readonly emUser_Comment_Salary i80 = new emUser_Comment_Salary(80, "8000+");
        public static readonly emUser_Comment_Salary i90 = new emUser_Comment_Salary(90, "9000+");
        public static readonly emUser_Comment_Salary i100 = new emUser_Comment_Salary(100, "10000+");
        public static readonly emUser_Comment_Salary i150 = new emUser_Comment_Salary(150, "15000+");
        public static readonly emUser_Comment_Salary i200 = new emUser_Comment_Salary(200, "20000+");
        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_Salary> _Items;
        public static List<emUser_Comment_Salary> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_Salary)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<emUser_Comment_Salary> BaseItems
        {
            get { return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static emUser_Comment_Salary Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_Salary Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_Salary(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 晋升机会
    /// <summary>
    /// 晋升机会
    /// </summary>
    public class emUser_Comment_Promotion_Chance : MyEnum<byte>
    {
        public static readonly emUser_Comment_Promotion_Chance All = new emUser_Comment_Promotion_Chance(255, "所有状态");
        public static readonly emUser_Comment_Promotion_Chance Selected = new emUser_Comment_Promotion_Chance(0, "请选择");
        public static readonly emUser_Comment_Promotion_Chance Fast = new emUser_Comment_Promotion_Chance(1, "很快");
        public static readonly emUser_Comment_Promotion_Chance Slow = new emUser_Comment_Promotion_Chance(2, "很慢");
        public static readonly emUser_Comment_Promotion_Chance General = new emUser_Comment_Promotion_Chance(3, "一般");
        public static readonly emUser_Comment_Promotion_Chance Impossible = new emUser_Comment_Promotion_Chance(4, "下辈子");
        public static readonly emUser_Comment_Promotion_Chance Other = new emUser_Comment_Promotion_Chance(9, "其他");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_Promotion_Chance> _Items;
        public static List<emUser_Comment_Promotion_Chance> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_Promotion_Chance)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<emUser_Comment_Promotion_Chance> BaseItems
        {
            get { return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static emUser_Comment_Promotion_Chance Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_Promotion_Chance Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_Promotion_Chance(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 同事关系
    /// <summary>
    /// 同事关系
    /// </summary>
    public class emUser_Comment_Relationship : MyEnum<byte>
    {
        public static readonly emUser_Comment_Relationship All = new emUser_Comment_Relationship(255, "所有状态");
        public static readonly emUser_Comment_Relationship Selected = new emUser_Comment_Relationship(0, "请选择");
        public static readonly emUser_Comment_Relationship SoSo = new emUser_Comment_Relationship(1, "各忙各的");
        public static readonly emUser_Comment_Relationship Good = new emUser_Comment_Relationship(2, "很好配合");
        public static readonly emUser_Comment_Relationship Bad = new emUser_Comment_Relationship(3, "很难配合");
        public static readonly emUser_Comment_Relationship EveryBad = new emUser_Comment_Relationship(4, "推卸责任");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_Relationship> _Items;
        public static List<emUser_Comment_Relationship> Items
        {
            get { return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_Relationship)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Comment_Relationship Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_Relationship Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_Relationship(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion


    #region 工作时间
    /// <summary>
    /// 工作时间
    /// </summary>
    public class emUser_Comment_WorkTime : MyEnum<byte>
    {
        public static readonly emUser_Comment_WorkTime All = new emUser_Comment_WorkTime(255, "所有状态");
        public static readonly emUser_Comment_WorkTime Selected = new emUser_Comment_WorkTime(0, "请选择");
        public static readonly emUser_Comment_WorkTime Good = new emUser_Comment_WorkTime(1, "朝九晚五");
        public static readonly emUser_Comment_WorkTime SoSo = new emUser_Comment_WorkTime(2, "偶尔加班");
        public static readonly emUser_Comment_WorkTime Bad = new emUser_Comment_WorkTime(3, "经常加班");
        public static readonly emUser_Comment_WorkTime EveryBad = new emUser_Comment_WorkTime(4, "压力很大");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Comment_WorkTime> _Items;
        public static List<emUser_Comment_WorkTime> Items
        {
            get { return Items.Where(p => p.Value != 255).ToList(); }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Comment_WorkTime)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Comment_WorkTime Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Comment_WorkTime Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Comment_WorkTime(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

}

